// old Auth.ts
import myaxios from '@/utils/instance'
class Login {
	/**
	 *  手机验证码登录
	 *  @url /app/mini/phone
	 *  @method post
	 */
	LoginCode_API = async (data?: {}) => {
		const res = await myaxios({
			method: 'post',
			url: '/app/mini/phone',
			data
		})
		return res.data
	}
	/**
	 *  发送验证码
	 *  @url /app/mini/captcha
	 *  @method post
	 */
	LoginCaptcha_API = async (data?: {}) => {
		const res = await myaxios({
			method: 'post',
			url: '/app/mini/captcha',
			data
		})
		return res.data
	}
	/**
	 *  获取用户信息
	 *  @url /app/mini/account/info
	 *  @method post
	 */
	AccountInfo_API = async (data?: {}) => {
		const res = await myaxios({
			method: 'post',
			url: '/app/mini/account/info',
			data
		})
		return res.data
	}
	/**
	 *  通过平台退出登录
	 *  @url /app/mini/user/logoutByPlatform
	 *  @method post
	 */
	logoutByPlatform_API = async (data?: any) => {
		const res = await myaxios({
			method: 'post',
			url: `/app/mini/user/logoutByPlatform?platform=${data.platform}`,
		})
		return res.data
	}
}
export default new Login()